﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using SimpleService.Config;

namespace testConfig
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ConfigHelper cfg = new ConfigHelper();
            cfg.fileName = "pompom1";
            Response.Write(cfg.fileName);
            cfg.Creat();

            cfg.Set("pompompom","popopopopiiiiiiiiiii");
            cfg.Set("tkli", "tklikiiiittktkt");
            cfg.Set("yichamnggg", "yyyyyyy");

            cfg.Set("mhc", "mhc");

            cfg.Remove("pompompom3");
            Response.Write(cfg.Get("tkli"));

            cfg.fileName = "mssql_sql";
            cfg.Creat();
            cfg.Set("select", " select * from [__table__] ");
            cfg.Set("where", " where [__key__] = __val__ ");
            cfg.Set("insert", " insert into [__table__] (__field__)  values (__fval__) ");
            cfg.Set("update", " update [__table__] set [__field__] = __fval__ where [__key__] = '__val__' ");
            cfg.Set("delete", " DELETE FROM [__table__] where [__table__].[__key__] = __val__  ");
            cfg.Set("maxkey", " select max(__key__) as maxID from [__table__]  ");
            cfg.Set("field_right", "[");
            cfg.Set("field_left", "]");



            cfg.fileName = "mysql_sql";
            cfg.Creat();
            cfg.Set("select", " select * from `__table__` ");
            cfg.Set("where", " where `__key__` = __val__ ");
            cfg.Set("insert", " insert into `__table__` (__field__)  values (__fval__) ");
            cfg.Set("update", " update `__table__` set `__field__` = __fval__ where `__key__` = '__val__' ");
            cfg.Set("delete", " DELETE FROM `__table__` where `__table__`.`__key__` = __val__ LIMIT 1 ");
            cfg.Set("maxkey", " select max(__key__) as maxID from `__table__`  ");
            cfg.Set("field_right", "`");
            cfg.Set("field_left", "`");


            cfg.fileName = "mvc";
            cfg.Creat();
            cfg.Set("templatePath", "\\template\\");
            cfg.Set("templateReloading", "true");
            cfg.Set("defaultPage", "Login");
            cfg.Set("defaultNamespace", "MVC");

        }
    }
}